home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / tcpech1a / clsgloba.cls < prev    next >
Encoding:
Visual Basic class definition  |  1999-08-25  |  1.9 KB  |  78 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "clsGlobal"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = False
  14. Option Explicit
  15.  
  16. 'Constants
  17. Const MyModule = "clsGlobal"
  18.  
  19. 'Variables
  20. Private gStartTime As Date
  21. Private gCurrentTime As Date
  22.  
  23. Friend Property Let CurrentTime(ByVal TheTime As Date)
  24.     'The time has been changed.
  25.     'Update the server and notify people.
  26.     
  27.     Const MyError = MyModule & "_" & "CurrentTime"
  28.     If Timings Then PerformanceStartTime MyError
  29.     On Error GoTo Err_Init
  30.     
  31.     'Set the time
  32.     gCurrentTime = TheTime
  33.     
  34.     'Update the server
  35.     CScreen.Time = TheTime
  36.     CScreen.DebugText = "The time has been changed to " & gCurrentTime
  37.     
  38.     'Notify people
  39.     
  40.     
  41.     If Timings Then PerformanceEndTime MyError
  42.     Exit Property
  43.     
  44. Err_Init:
  45.     CScreen.DebugText = MyError & ": " & Err.number & " - " & Err.Description
  46.     Resume Next
  47. End Property
  48.  
  49. Friend Property Get CurrentTime() As Date
  50.     CurrentTime = gCurrentTime
  51. End Property
  52.  
  53. Friend Property Let StartTime(ByVal TheTime As Date)
  54.     'Set the start time of the server.
  55.     
  56.     Const MyError = MyModule & "_" & "StartTime"
  57.     If Timings Then PerformanceStartTime MyError
  58.     On Error GoTo Err_Init
  59.     
  60.     'Set the time
  61.     gStartTime = TheTime
  62.     
  63.     'Update the server
  64.     CScreen.OutputText = "Incarnation server started at " & gStartTime
  65.  
  66.     If Timings Then PerformanceEndTime MyError
  67.     Exit Property
  68.     
  69. Err_Init:
  70.     CScreen.DebugText = MyError & ": " & Err.number & " - " & Err.Description
  71.     Resume Next
  72. End Property
  73.  
  74. Friend Property Get StartTime() As Date
  75.     StartTime = gStartTime
  76. End Property
  77.  
  78.